package com.tjetc.hw2;

import java.io.*;
import java.util.Scanner;

public class hw4 {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("data.txt"));
        BufferedReader bufferedReader = new BufferedReader(new FileReader("data.txt"));
        for (int i = 0; i < 3; i++) {
            bufferedWriter.write(scanner.next());
            bufferedWriter.newLine();
        }
        bufferedWriter.close();
        System.out.println("请输入你的验证码");
        String s = scanner.next();
        String line;
        while((line=bufferedReader.readLine())!=null){
            if(s.equals(line)){
                System.out.println("验证成功");
                break;
            }
            else{
                System.out.println("验证失败");
                break;
            }
        }
        bufferedReader.close();
    }
}
